import Vue from "vue";
import Vuex from "vuex";
import cookie from "vue-cookies";
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    user: cookie.get("user") ? cookie.get("user") : {}
  },
  mutations: {
    user(state, data) {
      cookie.set("user", data);
      state.user = data;
    }
  },
  actions: {}
});
